package com.equipment;

import com.util.EncodingUtil;

/**
 * 读系统 C1数据
 * @author Administrator
 *
 */
public class ReadSysRequest {
	// 帧开始标记
	private String STX = "55AA";
	// 串口帧序列号
	private String RSCTL = "00";
	// 长度
	private String Length = "";
	// 命令頭
	private String Heand = "FD";

	//
	private String CMD = "C1";
	public String getSTX() {
		return STX;
	}

	public void setSTX(String sTX) {
		STX = sTX;
	}

	public String getRSCTL() {
		return RSCTL;
	}

	public void setRSCTL(String rSCTL) {
		RSCTL = rSCTL;
	}

	public String getLength() {
		return Length;
	}

	public void setLength(String length) {
		Length = length;
	}

	public String getHeand() {
		return Heand;
	}

	public void setHeand(String heand) {
		Heand = heand;
	}

	public String getCMD() {
		return CMD;
	}

	public void setCMD(String cMD) {
		CMD = cMD;
	}

	public String getBCC() {
		return BCC;
	}

	public void setBCC(String bCC) {
		BCC = bCC;
	}

	// 异或效验值
	private String BCC = "";

	public String command(){
		Length =EncodingUtil.addzero(EncodingUtil.desToHex(
				(CMD).length() / 2,
				2), 2) ;
		String DATA = RSCTL +Length + Heand + CMD ;
		BCC = EncodingUtil.yihuo(EncodingUtil.change(DATA));
		String retn = STX + DATA + BCC;
		return retn;
	}

}
